<template lang="html">
    <div class="goodsdetail">
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-message"></i>&nbsp;修改消息</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <el-form ref="form" v-model="form" label-width="150px">
                <el-form-item label="ID：">
                    <el-input v-model="form.id" :disabled="true" style="width:360px"></el-input>
                </el-form-item>
                <el-form-item label="标题(中文)：">
                    <el-input v-model="form.title_cn" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="标题(英文)：">
                    <el-input v-model="form.title_en" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="banner图：">
                    <ul class="bannerUl">
                        <li v-for="(item,index) in form.banner_img"><img class="bannerImg" :src="item" /></li>
                    </ul>
                </el-form-item>
                <el-form-item label="分类：">
                    <el-input v-model="form.category_name1+'/'+form.category_name2+'/'+form.category_name3" :disabled="true" style="width:560px"></el-input>
                </el-form-item>
                <el-form-item label="价格：">
                    <el-input v-model="form.price" :disabled="true" style="width:360px"></el-input>
                </el-form-item>
                <el-form-item label="库存：">
                    <el-input v-model="form.stock" :disabled="true" style="width:360px"></el-input>
                </el-form-item>
                <el-form-item label="品相(中文)：">
                    <el-input v-model="form.out_view_cn" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="品相(英文)：">
                    <el-input v-model="form.out_view_en" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="来源(中文)：">
                    <el-input v-model="form.source_cn" :disabled="true" style="width:360px"></el-input>
                </el-form-item>
                <el-form-item label="来源(英文)：">
                    <el-input v-model="form.source_en" :disabled="true" style="width:360px"></el-input>
                </el-form-item>
                <el-form-item label="藏品描述(中文)：">
                    <el-input type="textarea" autosize v-model="form.description_cn" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="藏品描述(英文)：">
                    <el-input type="textarea" autosize v-model="form.description_en" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="详情图片：">
                    <ul class="bannerUl">
                        <li v-for="(item,index) in form.img_list"><img class="bannerImg" :src="item" /></li>
                    </ul>
                </el-form-item>
                <el-form-item label="是否是每周精选：">
                    <div v-show="form.is_fine == 1">是</div>
                    <div v-show="form.is_fine == 0">否</div>
                </el-form-item>
                <el-form-item label="是否是精品推荐：">
                    <div v-show="form.is_recommend == 1">是</div>
                    <div v-show="form.is_recommend == 0">否</div>
                </el-form-item>
                <el-form-item label="发布者：">
                    <el-input v-model="form.nick_name" :disabled="true" style="width:360px"></el-input>
                </el-form-item>
                <el-form-item label="手机号码：">
                    <el-input v-model="form.mobile" :disabled="true" style="width:360px"></el-input>
                </el-form-item>
                <el-form-item>
                    <router-link to="/goods"><el-button style="width:150px" type="primary">返回列表</el-button></router-link>
                </el-form-item>
            </el-form>
        </div>
    </div>
</template>

<script>
import {getGoodDetail} from '@/api/goods/list'
    export default {
        name: "goodsdetail",
        components:{
            
        },
        data() {
            return {
                id:'',//藏品id
               form:[],//藏品详情
            }
        },
        created(){
            //获取id
            if(this.$route.query.id || this.$route.query.id != ''){
                this.id = this.$route.query.id;
            }
            //获取藏品详情
           this.getGoodDetail();
        },
        mounted() {
            
        },
        methods: {
            //获取列表
           getGoodDetail(){
                var that = this;
                getGoodDetail(that.id).then(res => {
                    // console.log(res);
                    that.form = res.data;
                })
            },
        }
    }
</script>

<style lang="css" scoped>
.bannerUl li {
    float: left;
    margin-right:5px;
}
.bannerImg {
    width:120px;
    height:120px;
}
</style>
